package cn.yuanqiao.archive.detection.mapper;

import java.util.List;
import java.util.Map;

import cn.yuanqiao.archive.appManager.domain.TenantItemFolder;
import cn.yuanqiao.archive.detection.domain.Detection;
import cn.yuanqiao.archive.detection.domain.DetectionFile;
import cn.yuanqiao.archive.detection.domain.DetectionObject;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * 四性配置内容Mapper接口
 *
 * @author xy
 * @date 2023-08-08
 */
@Mapper
public interface DetectionObjectMapper
{
    /**
     * 查询四性配置内容
     *
     * @param id 四性配置内容主键
     * @return 四性配置内容
     */
    public DetectionObject selectDetectionObjectById(@Param("id") Long id,@Param("tableName") String tableName);

    /**
     * 查询四性配置内容列表
     *
     * @param detectionObject 四性配置内容
     * @return 四性配置内容集合
     */
    public List<DetectionObject> selectDetectionObjectList(DetectionObject detectionObject);

    /**
     * 新增四性配置内容
     *
     * @param detectionObject 四性配置内容
     * @return 结果
     */
    public int insertDetectionObject(DetectionObject detectionObject);

    /**
     * 修改四性配置内容
     *
     * @param detectionObject 四性配置内容
     * @return 结果
     */
    public int updateDetectionObject(DetectionObject detectionObject);

    /**
     * 删除四性配置内容
     *
     * @param id 四性配置内容主键
     * @return 结果
     */
    public int deleteDetectionObjectById(Long id);

    /**
     * 批量删除四性配置内容
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteDetectionObjectByIds(Long[] ids);

    void deleteDetectionObjectByPId(@Param("pid")Long pid,@Param("tableName") String tableName);

    int getDetailCount(@Param("pId")Long pId,@Param("tableName") String tableName);

    List<Map> getDh(@Param("rq") String rq, @Param("code") String code,@Param("categoryId") Long categoryId);

    int getCountByDetection(@Param("subTableName") String subTableName, @Param("fieldName") String fieldName, @Param("code") String code,@Param("value") String value);

    List<Detection> getDetection(@Param("list") List<DetectionObject> list);

    Map getFieldName(@Param("mddata") String daMddata,@Param("subTableName") String subTableName,@Param("daId")Long daId);

    String getDhValue(@Param("field") String field, @Param("daId") Long daId, @Param("code") String code,@Param("type") Integer type);

    List<DetectionFile> getDetectionFiles(@Param("eFileTableName") String eFileTableName, @Param("daId") Long daId);

    String getRq(@Param("daId") Long daId, @Param("subTableName") String subTableName);

    String getFieldNames(@Param("daId") Long daId, @Param("subTableName") String subTableName,@Param("field") String field);

    List<Long> getDaIdsByFolderId(@Param("folderId") Long daId,@Param("code") String code);

    List<Long> getFolderIdsBtItemId(@Param("tableName") String tableName, @Param("daId") Long daId, @Param("code") String code);

    Long getFolderIdByDaId(@Param("daId") Long daId, @Param("code") String code);

    List<Map> getDhByRq(@Param("rq") String rq, @Param("code") String code,@Param("categoryId") Long categoryId);

    void updateStateByfoldeId(@Param("allFolderIdList") List allFolderIdList, @Param("folderTableName")String folderTableName,@Param("satus") String satus,@Param("fileName") String fileName);

    int getSxCount(@Param("daId") Long daId, @Param("code") String tenantCode);

    void updateSxId(@Param("sxId") Long sxId, @Param("code")String tenantCode,@Param("daId") Long daId);

    void insertSxId(@Param("id") Long id,@Param("sxId") Long sxId, @Param("code") String tenantCode, @Param("daId") Long daId);

    Long getSxId(@Param("daId") Long daId, @Param("code") String tenantCode);

    List<Map<String, Object>> getName(@Param("groupId") Long groupId, @Param("type") int i, @Param("query") String query,@Param("tableName")String tableName);

    int getFailCount(@Param("dId") Long item, @Param("tableName") String tableName,@Param("pId") Long pId);

    int updateBatchDetectionObject(@Param("list") List<DetectionObject> detectionObjectList,@Param("tableName") String tableName);

    List<DetectionObject> selectDetectionObjectListByCode(@Param("code") String code, @Param("schemeTable") String schemeTable, @Param("objectTable") String objectTable, @Param("itemTable") String itemTable,@Param("mdataListTable")String mdataListTable);
}
